<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
<meta charset="utf-8" />
<title>商品管理 - 新增属性</title>
<?php include($this->c['_homes']['_viewsHome'].'/_global/_head.php');?>
</head>
<!-- BEGIN BODY -->
<body class="page-header-fixed page-sidebar-fixed">
<!-- BEGIN HEADER -->
<?php include($this->c['_homes']['_viewsHome'].'/_global/head.php');?>
<!-- END HEADER -->
<div class="clearfix"></div>
<!-- BEGIN CONTAINER -->
<div class="page-container" > 
  <!-- BEGIN HORIZONTAL MENU PAGE SIDEBAR1 -->
  <?php include($this->c['_homes']['_viewsHome'].'/_global/menu.php');?>
  <!-- END BEGIN HORIZONTAL MENU PAGE SIDEBAR --> 
  <!-- BEGIN PAGE -->
  <div class="page-content"> 
    <!-- BEGIN PAGE HEADER-->
    <div class="row">
      <div class="col-md-12"> 
        <!-- BEGIN PAGE TITLE & BREADCRUMB-->
        <h3 class="page-title"> 新增属性 </h3>
        <ul class="page-breadcrumb breadcrumb">
          <li> <i class="icon-home"></i> <a href="/manage">后台</a> <i class="icon-angle-right"></i> </li>
          <li> 商品管理 <i class="icon-angle-right"></i> </li>
          <li> <a href="/goods/type">商品类型</a> <i class="icon-angle-right"></i> </li>
          <li><a href="/goods/attribute?typeid=<?=$this->type['typeid'];?>"><strong><?=$this->type['name'];?></strong> 商品属性</a> <i class="icon-angle-right"></i> </li>
          <li>新增属性</li>
        </ul>
        <!-- END PAGE TITLE & BREADCRUMB--> 
      </div>
    </div>
    <!-- END PAGE HEADER--> 
    <!-- BEGIN PAGE CONTENT-->
    
    <div class="row">
      <div class="col-md-6"> 
        <!-- BEGIN SAMPLE FORM PORTLET-->
        <div class="portlet box blue">
          <div class="portlet-title">
            <div class="caption"> <i class="icon-reorder"></i> 基本信息 </div>
            <div class="tools"> <a href="" class="collapse"></a> </div>
          </div>
          <div class="portlet-body form">
            <form method="post" action="attrdo" onsubmit="return chkfrm();">
              <input type="hidden" name="act" value="add" />
              <input type="hidden" name="typeid" value="<?=$this->type['typeid'];?>" />
              <div class="form-body">
                <div class="form-group">
                  <label >所属类型</label>
                  <div class="input-group">
                    <h5><strong>
                      <?=$this->type['name'];?>
                      </strong></h5>
                  </div>
                </div>
                <hr>
                </hr>
                <div class="form-group">
                  <label>属性名称</label>
                  <div class="input-group">
                    <input type="text" class="form-control" name="name" value="" maxlength="20" id="_name">
                  </div>
                  <span class="help-block">20个汉字以内</span> </div>
                <hr>
                </hr>
                <div class="form-group">
                  <label>是否为筛选条件</label>
                  <div class="radio-list">
                    <label class="radio-inline">
                    <div id="uniform-optionsRadios24" class="radio"><span class="">
                      <input name="isfilter" id="optionsRadios24" value="1" type="radio">
                      </span></div>
                    是
                    </label>
                    <label class="radio-inline">
                    <div id="uniform-optionsRadios25" class="radio"><span>
                      <input name="isfilter" id="optionsRadios25" value="0" checked type="radio">
                      </span></div>
                    否
                    </label>
                  </div>
                </div>
                <hr>
                </hr>
                <div class="form-group">
                  <label>选择方式</label>
                  <div class="radio-list">
                    <label class="radio-inline">
                    <div id="uniform-optionsRadios4" class="radio"><span class="">
                      <input name="input_type" id="optionsRadios4" value="1" checked type="radio">
                      </span></div>
                    唯一属性
                    </label>
                    <label class="radio-inline">
                    <div id="uniform-optionsRadios5" class="radio"><span>
                      <input name="input_type" id="optionsRadios5" value="2" type="radio">
                      </span></div>
                    单选属性
                    </label>
                    <label class="radio-inline">
                    <div id="uniform-optionsRadios6" class="radio"><span>
                      <input name="input_type" id="optionsRadios6" value="3" type="radio">
                      </span></div>
                    多选属性
                    </label>
                    <span class="help-block">选择"单选/复选属性"时，可以对商品该属性设置多个值，同时还能对不同属性值指定不同的价格加价，用户购买商品时需要选定具体的属性值。<br>
                    选择"唯一属性"时，商品的该属性值只能设置一个值，用户只能查看该值。</span> </div>
                </div>
                <hr>
                </hr>
                <div class="form-group value_type">
                  <label>值录入方式</label>
                  <div class="radio-list">
                    <label class="radio-inline">
                    <div id="uniform-optionsRadios54" class="radio"><span class="">
                      <input name="value_type" id="_value_type1" id="optionsRadios4" value="1" checked type="radio">
                      </span></div>
                    手工录入
                    </label>
                    <label class="radio-inline">
                    <div id="uniform-optionsRadios55" class="radio"><span>
                      <input name="value_type" id="_value_type2" id="optionsRadios5" value="2" type="radio">
                      </span></div>
                    可选值列表选择
                    </label>                    
                    </div>
                </div>
                <hr>
                </hr>
                <div class="form-group">
                  <label>可选值列表</label>
                  <textarea class="form-control" name="values" id="_values" rows="10" disabled></textarea>
                  <span class="help-block">每行一个，值的顺序即为排序</span> </div>
                <hr>
                </hr>
                <div class="form-group">
                  <label>状态</label>
                  <div class="radio-list">
                    <label class="radio-inline">
                    <div id="uniform-optionsRadios4" class="radio"><span class="">
                      <input name="stat" id="optionsRadios14" value="1" checked type="radio">
                      </span></div>
                    <span class="label label-success">正常</span>
                    </label>
                    <label class="radio-inline">
                    <div id="uniform-optionsRadios5" class="radio"><span>
                      <input name="stat" id="optionsRadios15" value="2" type="radio">
                      </span></div>
                    <span class="label label-danger">禁用</span>
                    </label>
                  </div>
                </div>
                              </div>
              <div class="form-actions">
                <input type="submit" class="btn blue" value="提 交">
                <input type="button" class="btn default" value="返 回" onClick="history.back(1);">
              </div>
            </form>
          </div>
        </div>
        <!-- END SAMPLE FORM PORTLET--> 
        
      </div>
    </div>
    <!-- END PAGE CONTENT--> 
  </div>
  <!-- END PAGE --> 
</div>
<!-- END CONTAINER -->
<?php include($this->c['_homes']['_viewsHome'].'/_global/_footer.php');?>
<script>
	jQuery(document).ready(function() {    
	   App.init();
	   
	   $(".value_type").bind("click",function(){
			
			if($("#_value_type2").prop("checked") ){
				$("#_values").removeProp("disabled");	
			}
			else{
				$("#_values").prop("disabled","true");	
			}
			
			   
	   });
	});
</script> 
<script type="text/javascript">
function chkfrm(){
	if($("#_name").prop("value")==""){
		alert("请填写属性名称");
		$("#_name").focus();
		return false;
	}
	
	if($("#_value_type2").prop("checked") ){
	
		if($("#_values").prop("value")==""){
			alert("请填写可选值");
			$("#_values").focus();
			return false;
		}
	}
}
</script> 
<!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>